import 'package:date_format/date_format.dart';
import 'package:flutter/material.dart';
import 'package:flutter_pickers/pickers.dart';
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
import 'package:flutter_pickers/time_picker/model/suffix.dart';
import 'package:get/get.dart';
import 'package:lunar/calendar/Lunar.dart';
import 'package:lunar/calendar/Solar.dart';
import 'package:intl/intl.dart';

class PickerController extends StatefulWidget {
 @override
 _PickerControllerState createState() => _PickerControllerState();
}


class _PickerControllerState extends State<PickerController> {

 final myController = TextEditingController();

 @override
 void initState() {
  super.initState();

  myController.addListener(_printLatestValue);
 }

 @override
 void dispose() {
  // Clean up the controller when the widget is removed from the widget tree.
  // This also removes the _printLatestValue listener.
  myController.dispose();
  super.dispose();
 }

 _printLatestValue() {
  print("Second text field: ${myController.text}");
 }

 @override
 Widget build(BuildContext context) {
  return Scaffold(
   appBar: AppBar(
    title: Text('Retrieve Text Input'),
   ),
   body: Padding(
    padding: const EdgeInsets.all(16.0),
    child: Column(
     children: <Widget>[
      TextFormField (
       onChanged: (text) {
        print("First text field: $text");
       },
      ),
      TextFormField (
       controller: myController,
      ),
     ],
    ),
   ),
  );
 }
}
